(* This file is part of IsoType.
 *
 * IsoType is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * IsoType is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with IsoType.  If not, see <http://www.gnu.org/licenses/>.
 *)

type qname = Id of string
	     | Segment of string * qname
	     | Functor of string * string * qname

type name = string
type tvar = string

type type_expr = Ref of type_expr list * qname
		 | Var of tvar
		 | Arrow of type_expr * type_expr
		 | Tuple of type_expr list

type constructor = Constructor of name * type_expr list

type field = Field of name * type_expr

type type_body = Abstract
		 | Alias of type_expr
		 | Algebraic of constructor list
		 | Record of field list

type type_decl = tvar list * name * type_body
(* where tvar_list is a list of fparam ('a t = ...) *)
type value_decl = name * type_expr

type entity = Type of type_decl list
	      | Value of value_decl
	      | Exception of constructor
	      | Module of name * entity list
